<?php
require_once '../feedback.class.php';


echo "<h2>Test with existed feedback</h2>";
$feed = new Feedback(218);

// Tests get feedback ID
if ($feed->getId() == "218")
    echo "<p style='color:green;'>getId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getId(): Test failed.</p>";

// Tests get work ID
if ($feed->getWorkId() == "1") 
    echo "<p style='color:green;'>getWorkId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getWorkId(): Test failed.</p>";

// Tests get quality
if ($feed->getQuality() == "5")
    echo "<p style='color:green;'>getQuality(): Test passed.</p>";
else
    echo "<p style='color:red;'>getQuality(): Test failed.</p>";

// Tests get quality
if ($feed->getSpeed() == "6")
    echo "<p style='color:green;'>getSpeed(): Test passed.</p>";
else
    echo "<p style='color:red;'>getSpeed(): Test failed.</p>";

// Tests get coment
if ($feed->getComment() == "nu taip puse b*bio padaryta")
    echo "<p style='color:green;'>getComment(): Test passed.</p>";
else
    echo "<p style='color:red;'>getComment(): Test failed.</p>";

unset($feed);



echo "<h2>Test with new feedback</h2>";
$feed = new Feedback("3", "3", "3", "nepatenkinamai", "6");

// Tests set work ID
if ($feed->getWorkId() == "3") 
    echo "<p style='color:green;'>getWorkId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getWorkId(): Test failed.</p>";

// Tests get quality
if ($feed->getQuality() == "3")
    echo "<p style='color:green;'>getQuality(): Test passed.</p>";
else
    echo "<p style='color:red;'>getQuality(): Test failed.</p>";

// Tests get quality
if ($feed->getSpeed() == "3")
    echo "<p style='color:green;'>getSpeed(): Test passed.</p>";
else
    echo "<p style='color:red;'>getSpeed(): Test failed.</p>";

// Tests get coment
if ($feed->getComment() == "nepatenkinamai")
    echo "<p style='color:green;'>getComment(): Test passed.</p>";
else
    echo "<p style='color:red;'>getComment(): Test failed.</p>";

// Tests get user id
if ($feed->getUserId() == "6")
    echo "<p style='color:green;'>getUserId(): Test passed.</p>";
else
    echo "<p style='color:red;'>getUserId(): Test failed.</p>";

unset($feed);
?>
